home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / ftp-rfc < prev    next >
Text File  |  1995-07-21  |  579b  |  35 lines

  1. #!/usr/skunk/bin/expect --
  2.  
  3. # ftp-rfc <rfc-number>
  4. # ftp-rfc -index
  5.  
  6. # retrieves an rfc (or the index) from uunet
  7.  
  8. exp_version -exit 5.0
  9.  
  10. if $argc!=1 {
  11.     send_user "usage: ftp-rfc \[#] \[-index]\n"
  12.     exit
  13. }
  14.  
  15. set file "rfc$argv.Z"
  16.  
  17. set timeout 60
  18. spawn ftp ftp.uu.net
  19. expect "Name*:"
  20. send "anonymous\r"
  21. expect "Password:"
  22. send "expect@nist.gov\r"
  23. expect "ftp>"
  24. send "binary\r"
  25. expect "ftp>"
  26. send "cd inet/rfc\r"
  27. expect "550*ftp>" exit "250*ftp>"
  28. send "get $file\r"
  29. expect "550*ftp>" exit "200*226*ftp>"
  30. close
  31. wait
  32. send_user "\nuncompressing file - wait...\n"
  33. exec uncompress $file
  34.  
  35.